#include "kdcaudio.h"

#include <kdclib.h>

KDCAudio::KDCAudio( KDCAudioMetaData *aMetaData ) : pMetaData( aMetaData ), pEnabled( true ), pDelay( 0 ), pChannelCount( 0 ), pBitrate( 0 )
{

}

void KDCAudio::copySettings( const KDCAudio& aAudio )
{
	pEnabled = aAudio.isEnabled();
	pMode = aAudio.mode();
	pBitrate = aAudio.bitrate();
	pDelay = aAudio.delay();
	pChannelCount = aAudio.channelCount();
}

KDCAudioMetaData* KDCAudio::metaData() const
{
	return pMetaData;
}

void KDCAudio::setEnabled( bool aEnabled )
{
	pEnabled = aEnabled;
}

bool KDCAudio::isEnabled() const
{
	return pEnabled;
}

KDCAudio::~KDCAudio()
{
	deletePtr( pMetaData );
}

void KDCAudio::setChannelCount( int aCount )
{
	pChannelCount = aCount;
}

int KDCAudio::channelCount() const
{
	return pChannelCount;
}

void KDCAudio::setBitrate( int aBitrate )
{
	pBitrate = aBitrate;
}

int KDCAudio::bitrate() const
{
	return pBitrate;
}

int KDCAudio::delay() const
{
	return pDelay;
}

void KDCAudio::setDelay( int aDelay )
{
	pDelay = aDelay;
}

void KDCAudio::setCodec( KDC::AudioCodec aCodec )
{
	pCodec = aCodec;
}

KDC::AudioCodec KDCAudio::codec() const
{
	return pCodec;
}

KDC::StreamMode KDCAudio::mode() const
{
	return pMode;
}

void KDCAudio::setMode( KDC::StreamMode aMode )
{
	pMode = aMode;
}

quint64 KDCAudio::size() const
{
	return qRound( 0.000125*pMetaData->length()*pBitrate );
}

bool KDCAudio::operator!=( const KDCAudio& aAudio )
{
	return false;
}
